<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
<head>
    <th:block th:include="include :: header('修改商品评论')" />
    <th:block th:include="include :: datetimepicker-css" />
</head>
<body class="white-bg">
    <div class="wrapper wrapper-content animated fadeInRight ibox-content">
        <form class="form-horizontal m" id="form-comment-edit" th:object="${orderComment}">
            <input name="id" th:field="*{id}" type="hidden">
            <div class="form-group">    
                <label class="col-sm-3 control-label">评分：</label>
                <div class="col-sm-8">
                    <input name="grade" th:field="*{grade}" class="form-control" type="text" readonly="readonly">
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">评论内容：</label>
                <div class="col-sm-8">
                    <input name="context" th:field="*{context}" class="form-control" type="text" readonly="readonly">
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-3 control-label">评论图片：</label>
                <div class="col-sm-8">
                    <div id="img-url" style="padding: 5px;"></div>
                </div>
            </div>
            <!--<div class="form-group">    -->
                <!--<label class="col-sm-3 control-label">回复内容：</label>-->
                <!--<div class="col-sm-8">-->
                    <!--<input name="reply" th:field="*{reply}" class="form-control" type="text">-->
                <!--</div>-->
            <!--</div>-->
        </form>
    </div>
    <th:block th:include="include :: footer" />
    <th:block th:include="include :: datetimepicker-js" />
    <script type="text/javascript" th:inline="javascript">
        var prefix = ctx + "system/comment";
        $("#form-comment-edit").validate({
            focusCleanup: true
        });

        function submitHandler() {
            if ($.validate.form()) {
                $.operate.save(prefix + "/edit", $('#form-comment-edit').serialize());
            }
        }
        if(true) {
            var imgList =[[${imgList}]];
            for (o in imgList){
                $("#img-url").append(
                    "<img  src='" + imgList[o].url + "' style='width:100px;height: 80px;margin-bottom: 1px;'><br>"
                    );
            }
        }

    </script>
</body>
</html>